package com.company.java.basic.Singleton;

public class Singleton {
    private static Singleton instance = null;
    // 构造方法私有，不能在类的外面创建实例
    private Singleton(){}

    public static Singleton getInstance(){
        if (instance == null){
            instance = new Singleton();
        }
        return instance;
    }
}
